Ext.ux.ProjectTreeContextMenu = function(){
    var tree, menu, ctxItem;
    this.init = function(tp){
        tree = tp;
        tree.on('contextmenu', onContextMenu);
    }

    function onContextMenu(ts, item, e){
        if(!menu){ // create context menu on first right click
            menu = new Ext.menu.Menu([{
                id: 'CtxProjectCreate',
                text: 'Create',
                handler : function()
                {
                }
            }]);
        }
        ctxItem = item;
        var items = menu.items;
        items.get('CtxProjectCreate').setDisabled(!item.closable);
        menu.showAt(e.getPoint());
    }
};